﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ExamSystem.Mdeol;
using ExamSystem.BLL;
namespace ExamSystem.ht
{
    public partial class TPager_Add : System.Web.UI.Page
    {
        private TpagerBLL tbl = new TpagerBLL();
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void Button1_Click(object sender, EventArgs e)
        {
           //获取数据
            string name = this.tpName.Value.Trim();
            string begin = this.datemin.Value;
            string end = this.datemax.Value;
            //验证
            if(string.IsNullOrEmpty(name))
            {
                this.lbMsg.InnerText = "请输入试卷名称";
                return;
            }
            if(string.IsNullOrEmpty(begin))
            {
                this.lbMsg.InnerText = "请选择开始时间";
                return;
            }
            if(string.IsNullOrEmpty(end))
            {
                this.lbMsg.InnerText = "请选择结束时间";
                return;
            }
            //入库
            this.lbMsg.InnerText = "";
            Tpager t = new Tpager(0,name,begin,end);
            tbl.insert(t);
            util.FunHelper.LayerAlter(this, "添加成功", "TPager_List.aspx");
        }
    }
}